package TopDownProgramming;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

public class CalculatorTestNormal {
	
	public static void main(String[] args){
		Calculator calculator = new Calculator();
	}
	
	@BeforeClass
	public static void sebelumSemuaTest(){
		System.out.println("Sebelum semua test");
	}
	
	@AfterClass
	public static void setelahSemuaTest(){
		System.out.println("Setelah semua test");
	}
	
	@Before
	public void sebelumMasingMasingTest(){
		System.out.println("sebelum Masing-Masing Test");
	}
	
	@After
	public void setelahMasingMasingTest(){
		System.out.println("setelah Masing-Masing Test");
	}
	
	@Test
	public void tambah(){
		System.out.println("test tambah");
		Calculator c = new Calculator();
		
		Integer x = 10;
		Integer y = 15;
		
		Integer hasil = c.tambah(x,y);
		Assert.assertEquals(new Integer(10), hasil);
	}
	
	@Test
	public void Kurang(){
		System.out.println("test kurang");
		Calculator c = new Calculator();
		
		Integer x = 10;
		Integer y = 15;
		
		Integer hasil = c.Kurang(x,y);
		Assert.assertEquals(new Integer(-5), hasil);
	}
	
	@Test
	public void Kali(){
		System.out.println("test kali");
		Calculator c = new Calculator();
		
		Integer x = 10;
		Integer y = 15;
		
		Integer hasil = c.Kali(x,y);
		Assert.assertEquals(new Integer(150), hasil);
	}
	
	@Test
	public void Bagi(){
		System.out.println("test bagi");
		Calculator c = new Calculator();
		
		Integer x = 10;
		Integer y = 0;
		
		Integer hasil = c.Bagi(x,y);
		Assert.assertEquals(new Integer(0), hasil);
	}
}
